<?php
namespace Common\Model;
use Think\Model;

class ArticleDataModel extends Model{
	
	protected $tableName = 'article_data';

	//添加数据
	public function add_data($data=NULL){
		$this->add($data);
		
	}
	//获取数据
	public function get_data($where=NULL){
		if($where==NULL){
			$data=$this->order('csort asc')->select();
			return $data;
		}else{
			$data=$this->where($where)->find();
			return $data;
		}

	}

	//删除
	public function del_data($where=NULL){
		$this->where($where)->delete();
	}

	//修改
	public function save_data($where=NULL,$data=NULL){
		$this->where($where)->save($data);
	}
}
